Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle string errors in SandpackTests component #1208

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kangju2000
Copy link
Contributor

@kangju2000 kangju2000 commented Sep 22, 2024

close #1113

What kind of change does this pull request introduce?

The SandpackTests component was crashing when throwing a string instead of an Error instance.

Cause

The problem occurred because error.message was undefined, causing the escapeHtml function to fail when attempting to replace.

Solution

Implemented nullish handling to safely process cases where error.message is undefined.

AS-IS

2024-09-22.4.40.12.mov

TO-BE

default.mov

Checklist

  • Documentation;
  • Storybook (if applicable);
  • Tests;
  • Ready to be merged;

Copy link

codesandbox bot commented Sep 22, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Sep 22, 2024

@kangju2000 is attempting to deploy a commit to the CodeSandbox Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@danilowoz danilowoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@kangju2000
Copy link
Contributor Author

@danilowoz
As the current merge is blocked by unrelated test failures, please check and proceed with the merge 🙏

@danilowoz danilowoz merged commit 23c1b8d into codesandbox:main Sep 23, 2024
10 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw a string in SandpackTests will make the component crash
2 participants